﻿<%@ Page Title="Departure Flights" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="DepFlights.aspx.cs" Inherits="IFD2.DepFlights" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <link href="Datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>

    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label3" runat="server" Text="Airline:" meta:resourcekey="Airline" Enabled="False" Visible="False"></asp:Label><asp:TextBox ID="txtAirline" runat="server" Width="38px" Enabled="False" Visible="False"></asp:TextBox><asp:Label ID="Label1" runat="server" Text="Airport:" meta:resourcekey="Airport"></asp:Label>
                <asp:TextBox ID="txtAirport" runat="server" MaxLength="4" CssClass="form-control input-sm" Width="100%" ReadOnly="True"></asp:TextBox>
            </div>
            <div class="form-group">
                <asp:Label ID="Label2" runat="server" Text="Date:" meta:resourcekey="DepDate"></asp:Label>
                <asp:TextBox ID="txtFltDate" runat="server" CssClass="form-control input-sm form_date" Width="100%"></asp:TextBox>
            </div>
            <div class="form-group">
                <asp:Label ID="Label5" runat="server" Text="Time:" meta:resourcekey="DepartureTime"></asp:Label>
                <asp:TextBox ID="txtDepTimeFrom" runat="server" CssClass="form-control input-sm form_time" Width="100%" MaxLength="5">00:00</asp:TextBox>
                -<br />
                <asp:TextBox ID="txtDepTimeTo" runat="server" CssClass="form-control input-sm form_time" Width="100%" MaxLength="5">23:59</asp:TextBox>
            </div>
            <div class="form-group">
                <asp:Label ID="Label6" runat="server" Text="Status" meta:resourcekey="Status"></asp:Label>
                <asp:DropDownList ID="lstStatus" runat="server" CssClass="form-control input-sm" Width="100%">
                    <asp:ListItem Value="0" meta:resourcekey="Original" Text="Original"></asp:ListItem>
                    <asp:ListItem Value="I" meta:resourcekey="Initiated" Text="Initiated"></asp:ListItem>
                    <asp:ListItem Value="C" Selected="True" meta:resourcekey="Checking" Text="Checking In"></asp:ListItem>
                    <asp:ListItem Value="S" meta:resourcekey="Suspended" Text="Suspended"></asp:ListItem>
                    <asp:ListItem Value="B" meta:resourcekey="Boarding" Text="Boarding"></asp:ListItem>
                    <asp:ListItem Value="F" meta:resourcekey="Flown" Text="Flown"></asp:ListItem>
                </asp:DropDownList>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" style="min-width:1500px;width:100%;" class="table-hover"
                            DataKeyNames="flt_date,airline,flt_no" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <Columns>
                                <asp:TemplateField HeaderText="&#160;">
                                    <ItemTemplate>
                                        <input type="radio" name="KEY" value='<%#Eval("flt_date","{0:d}")+"|"+Eval("airline")+"|"+Eval("flt_no")+"|"+Eval("airport")+"|"+Eval("des_airport") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="time"  meta:resourcekey="time1">
                                    <ItemTemplate>
                                        <%#Convert.ToDateTime(Eval("dep_time")).ToShortTimeString() + "-" + Convert.ToDateTime(Eval("arr_time")).ToShortTimeString()%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="flight"  meta:resourcekey="flight1">
                                    <ItemTemplate>
                                        <%#Eval("airline")+""+Eval("flt_no")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="des_airport" HeaderText="des_airport" SortExpression="des_airport"  meta:resourcekey="des_airport" />
                                <asp:CheckBoxField DataField="virtual" HeaderText="virtual" SortExpression="virtual"  meta:resourcekey="virtual1" />
                                <asp:TemplateField HeaderText="carry_flight"  meta:resourcekey="carry_flight">
                                    <ItemTemplate>
                                        <%#Eval("op_airline") + "" + Eval("op_flt_no")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:CheckBoxField DataField="international" HeaderText="international" SortExpression="international"  meta:resourcekey="international" />
                                <asp:BoundField DataField="tail_no" HeaderText="tail_no" SortExpression="tail_no"  meta:resourcekey="tail_no" />
                                 <asp:BoundField DataField="seg_sn" HeaderText="seg_sn" SortExpression="seg_sn"  meta:resourcekey="seg_sn" />
                                <asp:BoundField DataField="stop_sn" HeaderText="stop_sn" SortExpression="stop_sn"  meta:resourcekey="stop_sn" />
                                <asp:CheckBoxField DataField="airport_ctl" HeaderText="airport_ctl" SortExpression="airport_ctl"  meta:resourcekey="airport_ctl" />
                                <asp:BoundField DataField="terminal" HeaderText="terminal" SortExpression="terminal"  meta:resourcekey="terminal" />
                                <asp:BoundField DataField="dcs_status" HeaderText="dcs_status" SortExpression="dcs_status"  meta:resourcekey="dcs_status" />
                                <asp:BoundField DataField="boarding_gate" HeaderText="boarding_gate" SortExpression="boarding_gate"  meta:resourcekey="boarding_gate" />
                                <asp:BoundField DataField="boarding_time" HeaderText="boarding_time" SortExpression="boarding_time"  meta:resourcekey="boarding_time" />
                                <asp:BoundField DataField="status" HeaderText="sale_status" SortExpression="status"  meta:resourcekey="sale_status" />
                                <asp:BoundField DataField="dcs_user" HeaderText="dcs_user" SortExpression="dcs_user"  meta:resourcekey="dcs_user" />
                                <asp:BoundField DataField="dcs_time" HeaderText="dcs_time" SortExpression="dcs_time"  meta:resourcekey="dcs_time" />
                            </Columns>
                            <RowStyle BackColor="#EFF3FB" />
                            <EditRowStyle BackColor="#2461BF" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                            SelectCommand="bll_flt_get_departure_flts" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                            <SelectParameters>
                                <asp:SessionParameter Name="airport" SessionField="DCS_AIRPORT" Type="String" />
                                <asp:ControlParameter ControlID="txtFltDate" Name="flt_date" PropertyName="Text"
                                    Type="DateTime" />
                                <asp:ControlParameter ControlID="lstStatus" Name="dcs_status" PropertyName="SelectedValue"
                                    Type="String" />
                                <asp:ControlParameter ControlID="txtDepTimeFrom" Name="dep_time_from" PropertyName="Text"
                                    Type="DateTime" />
                                <asp:ControlParameter ControlID="txtDepTimeTo" Name="dep_time_to" PropertyName="Text"
                                    Type="DateTime" />
                                <asp:SessionParameter Name="office" SessionField="OFFICE" Type="String" />
                                <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </div>
                    <div class="btn-group">
                        <asp:Button ID="btnPaxList" runat="server" CssClass="btn btn-sm btn-default" Text="Pax List..." OnClick="btnPaxList_Click"  meta:resourcekey="PaxList" />
                        <asp:Button ID="btnMiscServices" runat="server" CssClass="btn btn-sm btn-default" onclick="btnMiscServices_Click" Text="Misc. Services..." meta:resourcekey="MiscServices" />
                        <asp:Button ID="btnDCS_Init" runat="server" CssClass="btn btn-sm btn-default" Text="Initiate"  meta:resourcekey="DCSInit" OnClick="btnDCS_Init_Click"/>
                        <asp:Button ID="btnSeatMap" runat="server" CssClass="btn btn-sm btn-default" OnClick="btnSeatMap_Click" Text="Seat Map..."  meta:resourcekey="SeatMap" />
                        <asp:Button ID="btnLoadBalance" runat="server" CssClass="btn btn-sm btn-default" Text="Load Balance..."  meta:resourcekey="LoadBalance" OnClick="btnLoadBalance_Click" />
                        <asp:Button ID="btnClose" runat="server" CssClass="btn btn-sm btn-default" OnClick="btnClose_Click" Text="Close Flight" meta:resourcekey="CloseFlight" ForeColor="Red" />
                        <asp:Button ID="btnFinalPax" runat="server" CssClass="btn btn-sm btn-default" OnClick="btnFinalPax_Click" Text="Final Pax List..."  meta:resourcekey="FinalPaxList" />
                        <asp:Button ID="btnLogs" runat="server" CssClass="btn btn-sm btn-default" Text="Logs..." OnClick="btnLogs_Click"  meta:resourcekey="Logs" />
                    </div><br />
                    <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>

                    <div class="well well-sm">
                        <div class="form-group">
                        <asp:Label ID="Label4" runat="server" Text="New Status:" meta:resourcekey="NewStatus"></asp:Label>
                        <asp:DropDownList ID="lstNewStatus" runat="server">
                            <asp:ListItem Value="I" meta:resourcekey="Initiated" Text="Initiated"></asp:ListItem>
                            <asp:ListItem Value="C" meta:resourcekey="Checking" Text="Checking In"></asp:ListItem>
                            <asp:ListItem Value="S" meta:resourcekey="Suspended" Text="Suspended"></asp:ListItem>
                            <asp:ListItem Value="B" meta:resourcekey="Boarding" Text="Boarding"></asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <asp:Button ID="btnChangeStatus" runat="server" Text="Modify Status" OnClick="btnChangeStatus_Click"  meta:resourcekey="ModifyStatus" CssClass="btn btn-sm btn-default" />
                    </div>

                    <div class="well well-sm">
                        <div class="form-group">
                        <asp:Label ID="Label7" runat="server" Text="Gate:"  meta:resourcekey="Gate"></asp:Label>
                        <asp:TextBox ID="txtGate" runat="server" Width="41px" MaxLength="5"></asp:TextBox>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label8" runat="server" Text="Boarding Time:"  meta:resourcekey="BoardingTime"></asp:Label>
                        <asp:TextBox ID="txtBoardingTime" CssClass="form_time" runat="server" Width="52px" MaxLength="5"></asp:TextBox>
                        </div>
                        <asp:Button ID="btnSetBorading" runat="server" Text=" Set " OnClick="btnSetBorading_Click"  meta:resourcekey="Set" CssClass="btn btn-sm btn-default" />
                    </div>
                </div>
            </div>
        </div>
    </div>

    </div>
    </form>

    <script src="Datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script src="JS/ScrollableGridPlugin.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            //$('.form_datetime').datetimepicker({
            //    format: 'yyyy-m-d hh:ii',
            //    weekStart: 1,
            //    todayBtn: 1,
            //    autoclose: 1,
            //    todayHighlight: 1,
            //    startView: 'month',
            //    forceParse: 0,
            //    showMeridian: 0
            //});
            $('.form_date').datetimepicker({
                format: 'yyyy-m-d',
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 'month',
                minView: 'month',
                forceParse: 0
            });
            $('.form_time').datetimepicker({
                format: 'hh:ii',
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 'day',
                minView: 'hour',
                maxView: 'day',
                forceParse: 0
            });

            var win_height = parseInt($(window).height());
            var tab_new_height= win_height-50-100;//菜单占50， 为便于操作留空100
            if ($('#<%=GridView1.ClientID %>').height()>tab_new_height)
                $('#<%=GridView1.ClientID %>').Scrollable({ ScrollHeight: tab_new_height });
        });
    </script>

</asp:Content>
